UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZYmZlinldzGfrM2nksePc+PdRd9sHPFTltce4Un2jko=' 
WHERE 
  key_id = '73d94717229a84822e790a533702670437acd546c4228ced5aa6c6b83e466ef6' 
  AND (
    token = 'ZYmZlinldzGfrM2nksePc+PdRd9sHPFTltce4Un2jko=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014