UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DwOmZsO1+yHbN1rySDAnPyl31Ii1TFBaJR8YRkyQ3So=' 
WHERE 
  key_id = '3f0c35433472d8f65646d842f91e91781e64b8cf1723c66affc250b939da373e' 
  AND (
    token = 'DwOmZsO1+yHbN1rySDAnPyl31Ii1TFBaJR8YRkyQ3So=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042