UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lZE9H1r4TW183DRu81cMyWgLoRie6rb6eud177NcOGU=' 
WHERE 
  key_id = '9ecfbd3b783dae9ef06bbe930d192ecef21842d427f9e9b43caf5cca60a3144c' 
  AND (
    token = 'lZE9H1r4TW183DRu81cMyWgLoRie6rb6eud177NcOGU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030