UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QEakW3uZ8mvo5f0ePuK0kukrGjdaOfnynzW3irHxiqI=' 
WHERE 
  key_id = '5a84cf8d6e5115580c49748a0a132573d4ff5da1644bfa1231a8edfbe109cf36' 
  AND (
    token = 'QEakW3uZ8mvo5f0ePuK0kukrGjdaOfnynzW3irHxiqI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045