UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qQIhgEnWlvfjPfmzuGKGM4jHKFit2JOn5FJd3kZV8io=' 
WHERE 
  key_id = '60f0baa25ed65202ca4b3d40142419b41d9145bfda3f4fb4274fff33e6265954' 
  AND (
    token = 'qQIhgEnWlvfjPfmzuGKGM4jHKFit2JOn5FJd3kZV8io=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018