UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xa6umw4eEgYTFfsDQ/g27d6K1Cq3/V7ptW6HeEFDdNs=' 
WHERE 
  key_id = 'ec8211e1ce528fb6fa614172489d95432abc1a9875f398b2a3d309b2766cd9d3' 
  AND (
    token = 'xa6umw4eEgYTFfsDQ/g27d6K1Cq3/V7ptW6HeEFDdNs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051