UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wBtBg2cZssgmsrlMGiscQJHQK9HZfqZdPEzA6Hy143I=' 
WHERE 
  key_id = '3842d699b931f4077d01f4105386340f7b896da88bd582152e383aaa00ebf12b' 
  AND (
    token = 'wBtBg2cZssgmsrlMGiscQJHQK9HZfqZdPEzA6Hy143I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038