UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EgKua24CpnwPyGFX0LAlm3aYsDM+ouEMhSbxoO312oI=' 
WHERE 
  key_id = '7284bbfd5b53bad7cf8ea2c7db9e88961c57f9c6fccba9a228d39e3756fdbccc' 
  AND (
    token = 'EgKua24CpnwPyGFX0LAlm3aYsDM+ouEMhSbxoO312oI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00070