UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vbuSSB3MktGxQWCTO0RxTA0MUG+BV3cMLOJlCHuLp5U=' 
WHERE 
  key_id = 'afcd4574406a7df4bf3f88d2d0529a8fd2e2d2972bf9ff88c9658b405d2fd2f4' 
  AND (
    token = 'vbuSSB3MktGxQWCTO0RxTA0MUG+BV3cMLOJlCHuLp5U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00077