UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FED0fCpxx8z2Eyjq7CBHzFeRFndYFt+jeKKyTlIKvRw=' 
WHERE 
  key_id = '2b189b1878c735f8236b6769404b924b11866dd68eda08503e8994818bd0b53c' 
  AND (
    token = 'FED0fCpxx8z2Eyjq7CBHzFeRFndYFt+jeKKyTlIKvRw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033