UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XuUQIpd8qCuL+tKV6zXJsIJtfCQVskRvEx3qQv/vOpo=' 
WHERE 
  key_id = '8574fe41b9b4a0b34a9389238ccb2449ea63433737f54a0dbc60f8b963c981aa' 
  AND (
    token = 'XuUQIpd8qCuL+tKV6zXJsIJtfCQVskRvEx3qQv/vOpo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040