UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WBqey0erDGg6q8SbJkXv8JttbiPTb6GKulQ/cJmXHjE=' 
WHERE 
  key_id = '3156af8d286ff2348f81fea8daf2776cf09fd33b9e228b77b7ff0fece04806ee' 
  AND (
    token = 'WBqey0erDGg6q8SbJkXv8JttbiPTb6GKulQ/cJmXHjE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00107