UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0ZkTL+Fc1QWd/BHReaEVRG6tSXnPJENAQFEOdiHuW28=' 
WHERE 
  key_id = '203bf84f4c122954d52edf302100084bac08c8ec634cd5e78a5f20622d5b1d4f' 
  AND (
    token = '0ZkTL+Fc1QWd/BHReaEVRG6tSXnPJENAQFEOdiHuW28=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023