UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JSpmSwtUHKU/L3xEgF/NmhtHuNwqu0njSfF55kBi90M=' 
WHERE 
  key_id = '2e75ad2283f7e060157b3e7db6f3290a1e85d940d198e3b1de48868ce648bd2a' 
  AND (
    token = 'JSpmSwtUHKU/L3xEgF/NmhtHuNwqu0njSfF55kBi90M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019