UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1qQHj8EgzaFZUXouyOzYtSbOG+sQgeKZis+FP4AOANU=' 
WHERE 
  key_id = 'b05bc81ce811d005dd6a6000a3dedc2d9042f6e00cee81b8c092273d4afb346d' 
  AND (
    token = '1qQHj8EgzaFZUXouyOzYtSbOG+sQgeKZis+FP4AOANU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033