UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+G+uPQTM5nuzKqQmyUR7bZpza5e64/JupOdzwAzKZZE=' 
WHERE 
  key_id = 'b86f0f1543037fe6895c75577cb54522d97fc078f18d94b0cca99622c04f84a2' 
  AND (
    token = '+G+uPQTM5nuzKqQmyUR7bZpza5e64/JupOdzwAzKZZE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034