UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tgRjR3ZiIPdHyIdP32rQ0NpO5TOR372cHi/SOzyWXHA=' 
WHERE 
  key_id = '75356b42fc9dd377d81063d4c5c77af510c6c7fa29bdc2d8a21ffed8a36c7743' 
  AND (
    token = 'tgRjR3ZiIPdHyIdP32rQ0NpO5TOR372cHi/SOzyWXHA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00082