UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ya2XSogGDvMaZwYrhyyDh6uGazZ1y8MdJfz/Gl168ww=' 
WHERE 
  key_id = '62737f03cf54933e03be06c7daf66a9fd461e7bd6bae635e4ef801516aad7173' 
  AND (
    token = 'ya2XSogGDvMaZwYrhyyDh6uGazZ1y8MdJfz/Gl168ww=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045