UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fot4jLJR7rOQOGT+sWB4OD8Lk8xrKuJG9KxJou+E+kI=' 
WHERE 
  key_id = '59a2a4c77a7094895bff8153cb31cb88f4be26a752b495cdecc9fd9a2bb14884' 
  AND (
    token = 'fot4jLJR7rOQOGT+sWB4OD8Lk8xrKuJG9KxJou+E+kI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020