UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0JgvKxtWdYPGyLsNpGPlPfXodsSocXlEA+wJ/Kv43jI=' 
WHERE 
  key_id = 'ed5ce229f08bc09f9c385ef25c919b424b20e4323ae4ea348716f3ea0b322d4a' 
  AND (
    token = '0JgvKxtWdYPGyLsNpGPlPfXodsSocXlEA+wJ/Kv43jI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029