UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'toW0jNjTjvZghwriPdjhZOpPjd+SDHrU5pmNvppkQk8=' 
WHERE 
  key_id = '3b3bb1bec87d54b908cf6cb5cfecb7e1eb88f6b1e6e6b9c3e7efb0fcfa958f9a' 
  AND (
    token = 'toW0jNjTjvZghwriPdjhZOpPjd+SDHrU5pmNvppkQk8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040