UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b3T2J6utdx6DsU3Neq4Rsf1/SG1E0I/k6VQ4sO0FnyE=' 
WHERE 
  key_id = 'c464d5049f5a0ac541691ad0f0df37b0be9b178b1ac60591bb9fdc6efe3cb7e6' 
  AND (
    token = 'b3T2J6utdx6DsU3Neq4Rsf1/SG1E0I/k6VQ4sO0FnyE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031