UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hdqxdxjaH5lm/ezr8gSPmHeWmXu0aljzjZVNh9WG0sk=' 
WHERE 
  key_id = '307cd7a303c44042c56bc3e6b66b3a279814723e9c08237cb57168b6a51b8ea0' 
  AND (
    token = 'hdqxdxjaH5lm/ezr8gSPmHeWmXu0aljzjZVNh9WG0sk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029