UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7k3EAi1lCgBxkchx0bsMSAqslLdEy1+XZagPN1xeNhM=' 
WHERE 
  key_id = '63978061bea23611b2c8e6f76dbb26a9d1beef7803fae8d3e963cc36fb9c4955' 
  AND (
    token = '7k3EAi1lCgBxkchx0bsMSAqslLdEy1+XZagPN1xeNhM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017