UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oYtbtE/rK6IaHm1UI4yFZ+dSFi2VEmamGoHWfQxnRUs=' 
WHERE 
  key_id = '3d2390266684284427bc0249dcba393a6ff666e32032db8c9e267c8bfaf28f78' 
  AND (
    token = 'oYtbtE/rK6IaHm1UI4yFZ+dSFi2VEmamGoHWfQxnRUs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041