UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gRN+oErtraecUBpFfewXbMnYIOuF1uLN6ErE44EP9nA=' 
WHERE 
  key_id = 'b63d8eb17d7ec99bb97c746f4b1b26d42f954cbbcb5b25dd974929d008a7534c' 
  AND (
    token = 'gRN+oErtraecUBpFfewXbMnYIOuF1uLN6ErE44EP9nA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047