UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PogYKmY7tX5oGWwXjOP4/cUFWrJHExXEPfjL3lOWo/E=' 
WHERE 
  key_id = '6b82c616b1f3c76d0a3a5a11a5fc545ce96abc36e76813f3cddc109aa52aa8b8' 
  AND (
    token = 'PogYKmY7tX5oGWwXjOP4/cUFWrJHExXEPfjL3lOWo/E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028