UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qE4thhKV/IlS0yUXcII77sqQwprNps2sHNlsLJ2IQgM=' 
WHERE 
  key_id = '75d139b654193f72b6111c5374744beb6dea6b8dc8c8a86f1b5bfc91e062451a' 
  AND (
    token = 'qE4thhKV/IlS0yUXcII77sqQwprNps2sHNlsLJ2IQgM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030