UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/ljTh4XGnyz75ch+3aH2MKXDuG7u41oePZ/ior0FcA0=' 
WHERE 
  key_id = '5135a93724f58562ececda963f748c64a4bb63be8daee4281358b5a2c5e92bd3' 
  AND (
    token = '/ljTh4XGnyz75ch+3aH2MKXDuG7u41oePZ/ior0FcA0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036