UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jrkuAJv+gf5vQIV5SSLLHqpE+w+d+hGa8oT9wKgTEKI=' 
WHERE 
  key_id = '5dd88c7147e7cf3b43ff6e399d7719d3331339265d0c23184c144138276dc54a' 
  AND (
    token = 'jrkuAJv+gf5vQIV5SSLLHqpE+w+d+hGa8oT9wKgTEKI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023