UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QAuLlehLIVx9/6E63gldwSvWEUqp9ofG4Oo6cUqp2sQ=' 
WHERE 
  key_id = 'cffab65914aebf278aa1a4343df1317b528aa419972a89c6cbd2a6e5301e10a2' 
  AND (
    token = 'QAuLlehLIVx9/6E63gldwSvWEUqp9ofG4Oo6cUqp2sQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041