UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SB9vXK2F/ugElSSRa9aAU4efY8mZDkB/LSX6SExVhGQ=' 
WHERE 
  key_id = '2e5a5405c20947ba5ab32eb507b5e85874831e0564e1e5df4efa4440cd86045a' 
  AND (
    token = 'SB9vXK2F/ugElSSRa9aAU4efY8mZDkB/LSX6SExVhGQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031